package com.boy.controller;

import com.boy.service.FileService;
import com.boy.tool.annotate.Arbitrarily;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * @author whd
 * @date 2024/05/31 10:59:29
 */

@RestController
@RequestMapping("/file")
public class FileController {
    @Autowired
    private FileService fileService;

    @Arbitrarily
    @PostMapping("/uploadFile")
    public String uploadFile(MultipartFile file) {
        //获取文件，调用接口上传文件，获取url
        return fileService.uploadFile(file);
    }

}
